#! -- encoding:utf8 --
import pandas as pd

dijkstra = []
# floyd = []
with open('time.txt','r',encoding='utf8') as f:
    lines=f.readlines()
    # a1=a2=a3=a4=a5=a6=a7=a8=a9=a10=[]
    for line in lines:
        listpre=line.strip().split("\t")
        if len(listpre)>2:
            # print(listpre[2],listpre[4])
            dijkstra.append(listpre[2])
            # floyd.append(listpre[4])

di=[]
# fl=[]
for j in range(26):
    for i in range(10):
        di.append(dijkstra[j+i*26])
        # fl.append(floyd[j+i*26])

for i in range(10):
    for j in range(26):
        with open('cleantime_dij.txt','a',encoding='utf8') as f:
            f.write(di[i+j*10])
            f.write("\t")
    with open('cleantime_dij.txt', 'a', encoding='utf8') as f:
        f.write("\n")

# for i in range(10):
#     for j in range(26):
#         with open('cleantime_floyd.txt', 'a', encoding='utf8') as f:
#              f.write(fl[i + j * 10])
#              f.write("\t")
#     with open('cleantime_floyd.txt', 'a', encoding='utf8') as f:
#         f.write("\n")

# dataframe = pd.DataFrame({'dijkstra': listpre[2], 'floyd': listpre[4]})
# dataframe.to_csv('time.csv', index=False, header=False)